home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROGS.ZIP / PACK.ICN < prev    next >
Text File  |  1992-09-28  |  1KB  |  38 lines

  1. ############################################################################
  2. #
  3. #    File:     pack.icn
  4. #
  5. #    Subject:  Program to package multiple files
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     May 27, 1989
  10. #
  11. ###########################################################################
  12. #
  13. #     This programs reads a list of file names from standard input and
  14. #  packages the files into a single file, which is written to standard
  15. #  output.
  16. #
  17. #     Files are separated by a header, ##########, followed by the file
  18. #  name.  This simple scheme does not work if a file contains such a header
  19. #  itself, and it's problematical for files of binary data.
  20. #
  21. ############################################################################
  22. #
  23. #  See also:  unpack.icn
  24. #
  25. ############################################################################
  26.  
  27. procedure main()
  28.    local in
  29.  
  30.    while name := read() do {
  31.       close(\in)
  32.       in := open(name) | stop("cannot open input file: ",name)
  33.       write("##########")
  34.       write(name)
  35.       while write(read(in))
  36.       }
  37. end
  38.